<template>
  <div>
    <NavBar :title="title" />
    <div class="content-top">
      <van-cell-group>
        <van-cell title="我的账号" is-link size="large" @click="onAccount" />
        <van-cell title="修改密码" is-link size="large" @click="onChangePWD" />
      </van-cell-group>
      <van-cell-group style="margin-top: 10px" @click="onAboutUs">
        <van-cell title="关于我们" is-link size="large" />
      </van-cell-group>
      <div style="margin-top: 10px">
        <van-button block plain size="large" type="primary" text="注销账号" style="border-color: #fff; font-size: 17px; color: #f44" @click="onLogOut"></van-button>
        <span v-if="false" @click="onZX" style="display: flex;justify-content: center;align-items: center;margin-top: 20px;font-size: 14px;color: #b8b8b8;">注销账号</span>
      </div>
    </div>
  </div>
</template>

<script>
import NavBar from "@/components/NavBar.vue";
import { Cell, CellGroup, Button, Dialog } from "vant";
import { clearAll, switchUserType } from "@/util/session";
import { onIMLogOut } from "@/util/im";
import MyMixin from '@/mixin/MyMixin';
export default {
  name: "IndexPage",
  components: {
    NavBar,
    [Cell.name]: Cell,
    [CellGroup.name]: CellGroup,
    [Button.name]: Button,
  },
  props: ["title"],
  // 定义属性
  data() {
    return {};
  },
	mixins:[MyMixin],
  // 方法集合
  methods: {
    //我的账号
    onAccount() {
      this.$router.push({ name: "person-setting-account" });
    },
    //修改密码
    onChangePWD() {
      this.$router.push({ name: "person-setting-changepwd" });
    },
    //关于我们
    onAboutUs() {
      this.$router.push({ name: "person-my-setting-about" });
    },
    //退出
    onLogOut() {
      this.userLogout('P');
    },
    // //注销
    // onZX() {
    //   Dialog.confirm({ message: "确认注销账号？", }).then(() => {
    //     switchUserType("P");
    //     onIMLogOut();
    //     this.$bus.$off();
    //     this.$router.go(-1);
    //   })
    // },
  },
};
</script>

<style lang="less">
@import "vant/lib/dialog/index.less";
@import "@/assets/css/common.less";
</style>
